/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_out_retur_to_wh_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionOutReturToWhDetail.findAll", query = "SELECT p FROM PosTransactionOutReturToWhDetail p"),
//    @NamedQuery(name = "PosTransactionOutReturToWhDetail.findBySync", query = "SELECT p FROM PosTransactionOutReturToWhDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionOutReturToWhDetail.findByReturDetailId", query = "SELECT p FROM PosTransactionOutReturToWhDetail p WHERE p.returDetailId = :returDetailId"),
//    @NamedQuery(name = "PosTransactionOutReturToWhDetail.findByReturDetailQuantity", query = "SELECT p FROM PosTransactionOutReturToWhDetail p WHERE p.returDetailQuantity = :returDetailQuantity"),
//    @NamedQuery(name = "PosTransactionOutReturToWhDetail.findByReturDetailPrice", query = "SELECT p FROM PosTransactionOutReturToWhDetail p WHERE p.returDetailPrice = :returDetailPrice")})
public class PosTransactionOutReturToWhDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "retur_detail_id")
    private Integer returDetailId;
    @Column(name = "retur_detail_quantity")
    private BigDecimal returDetailQuantity;
    @Column(name = "retur_detail_price")
    private BigDecimal  returDetailPrice;
    @Lob
    @Column(name = "retur_detail_description")
    private String returDetailDescription;
    @JoinColumn(name = "retur_detail_retur_id", referencedColumnName = "retur_id")
    @ManyToOne
    private PosTransactionOutReturToWarehouse returDetailReturId;
    @JoinColumn(name = "retur_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private PosMasterItem returDetailItemId;

    public PosTransactionOutReturToWhDetail() {
    }

    public PosTransactionOutReturToWhDetail(Integer returDetailId) {
        this.returDetailId = returDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getReturDetailId() {
        return returDetailId;
    }

    public void setReturDetailId(Integer returDetailId) {
        this.returDetailId = returDetailId;
    }

    public BigDecimal getReturDetailQuantity() {
        return returDetailQuantity;
    }

    public void setReturDetailQuantity(BigDecimal returDetailQuantity) {
        this.returDetailQuantity = returDetailQuantity;
    }

    public BigDecimal getReturDetailPrice() {
        return returDetailPrice;
    }

    public void setReturDetailPrice(BigDecimal returDetailPrice) {
        this.returDetailPrice = returDetailPrice;
    }

    public String getReturDetailDescription() {
        return returDetailDescription;
    }

    public void setReturDetailDescription(String returDetailDescription) {
        this.returDetailDescription = returDetailDescription;
    }

    public PosTransactionOutReturToWarehouse getReturDetailReturId() {
        return returDetailReturId;
    }

    public void setReturDetailReturId(PosTransactionOutReturToWarehouse returDetailReturId) {
        this.returDetailReturId = returDetailReturId;
    }

    public PosMasterItem getReturDetailItemId() {
        return returDetailItemId;
    }

    public void setReturDetailItemId(PosMasterItem returDetailItemId) {
        this.returDetailItemId = returDetailItemId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (returDetailId != null ? returDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionOutReturToWhDetail)) {
            return false;
        }
        PosTransactionOutReturToWhDetail other = (PosTransactionOutReturToWhDetail) object;
        if ((this.returDetailId == null && other.returDetailId != null) || (this.returDetailId != null && !this.returDetailId.equals(other.returDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ronsicecream.pos.entities.PosTransactionOutReturToWhDetail[ returDetailId=" + returDetailId + " ]";
    }
    
}
